<!DOCTYPE html>
<html lang="en">
<head>
  <!-- Use correct character set. -->
  <meta charset="utf-8">
  <!-- Tell IE to use the latest, best version. -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
  <title>Hello World!</title>
  <script src="Cesium/Cesium.js"></script>
  <style>
      @import url(Cesium/Widgets/widgets.css);
      html, body, #cesiumContainer {
          width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;
      }
  </style>
</head>
<body>
  <div id="cesiumContainer"></div>
  <script>
    var viewer = new Cesium.Viewer('cesiumContainer',{
	});
	
	worldRectangle = viewer.scene.primitives.add(new Cesium.Primitive({
        geometryInstances : new Cesium.GeometryInstance({
            geometry : new Cesium.RectangleGeometry({
                rectangle : Cesium.Rectangle.fromDegrees(-180.0, -90.0, 180.0, 90.0),
                vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
            })
        }),
        appearance : new Cesium.EllipsoidSurfaceAppearance({
            aboveGround : false
        }),
        show : true
    }));
	function applyDiffuseMaterial(primitive) {
		/*primitive.appearance.material =  new Cesium.ImageMaterialProperty({
			image:new Cesium.CallbackProperty(function() {
				return canvas;
			}, false),
			transparent:true
		});*/
		var fps = 60.0;
		var duration = 5;
		var divide = fps*duration;
		primitive.appearance.material = new Cesium.Material({
			fabric :{
			  materials : {
					diffuseMaterial : {
						type : 'DiffuseMap',
						uniforms : {
							image : 'wind/2016112000.png'
						}
					},
				  diffuseMaterial2 : {
						type : 'DiffuseMap',
						uniforms : {
							image : 'wind/2016112006.png',
							channel : 'a'
						}
					}
			  },
			  components : {
				diffuse : 'mix(diffuseMaterial.diffuse,diffuseMaterial2.diffuse,mod(czm_frameNumber,'+divide+'.0)/'+divide+'.0)',//'vec3(0.01*mod(czm_frameNumber,60.0))',
				//specular : '1.0',
				//alpha:'0.5'//'alphaMaterial.alpha/60.0*mod(czm_frameNumber,60.0)'
			  }
			}
		});
	}
	applyDiffuseMaterial(worldRectangle);
  </script>
</body>
</html>
